package edu.berkeley.cs160.innovationers.shoppersidekick.sync;

/**
 * When the login information is incorrect.
 * @author Nadir Muzaffar
 *
 */
@SuppressWarnings("serial")
public class UserLoginException extends Exception {

	public UserLoginException(int exceptionCase) {
		this.exceptionCase = exceptionCase;
	}
	
	/**
	 * Used to tell user of the error. Makes the login process more informative.
	 * @return String
	 */
	public String loginErrorString() {
		switch( exceptionCase ) {
		case 0:
			return "Could not find username";
		case 1:
			return "Incorrect password";
		case 2:
			return "Active session";
		default:
			return "Login error!";
		}
	}
	
	int exceptionCase;
}
